package com.vhall.component.controller.version.facade;

import com.vhall.component.entity.version.vo.ReqVersionManagePage;
import com.vhall.component.entity.version.vo.RespVersionManagePage;
import com.vhall.component.entity.version.vo.VersionManageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 版本控制
 *
 * @author jingwen.li
 */
@FeignClient(name = "VersionManageFacade", path = "/v4/version")
public interface VersionManageFacade {

    /**
     * 新增版本
     *
     * @param vo 版本数据
     * @return boolean
     */
    @PostMapping("/add")
    boolean addVersionManage(@Validated VersionManageVO vo);

    /**
     * 编辑版本
     *
     * @param vo 版本信息
     * @return boolean
     */
    @PostMapping("/update")
    boolean update(@Validated VersionManageVO vo);

    /**
     * 删除
     *
     * @param id 主键ID
     * @return boolean
     */
    @PostMapping("/delete")
    boolean delete(@RequestParam("id") Integer id);

    /**
     * 分页查询
     *
     * @param reqVersionManagePage 查询数据
     * @return page分页数据
     */
    @GetMapping("/page-list")
    RespVersionManagePage page(@Validated ReqVersionManagePage reqVersionManagePage);

    /**
     * 详情
     * @param id 主键ID
     * @return vo
     */
    @GetMapping("/info")
    VersionManageVO info(@RequestParam("id") Integer id);

    /**
     * 详情(APP调用)
     * @param pf  平台
     * @param version 版本号
     * @return
     */
    @PostMapping("/api/detail")
    VersionManageVO detail(@RequestParam("pf") String pf, @RequestParam("version") String version);
}
